package com.iis.hrms.persistence;

import javax.persistence.*;
import java.io.Serializable;

/**
 * The persistent class for the menu database table.
 */
@Entity
@Table(name = "menu")
@NamedQueries({
        @NamedQuery(name = "Menu.findAll", query = "SELECT m FROM Menu m"),
        @NamedQuery(name = "Menu.findById", query = "SELECT m FROM Menu m WHERE m.id = :id"),
        @NamedQuery(name = "Menu.findByName", query = "SELECT m FROM Menu m WHERE m.name = :name"),
        @NamedQuery(name = "Menu.findByUrl", query = "SELECT m FROM Menu m WHERE m.url = :url")})
public class Menu implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(unique = true, nullable = false)
    private String id;

    @Column(nullable = false, length = 255)
    private String name;

    @Column(nullable = false, length = 255)
    private String url;

    // bi-directional many-to-one association to GroupLogin
    @ManyToOne
    @JoinColumn(name = "id_group", nullable = false)
    private GroupLogin groupLogin;

    public Menu() {
    }

    public String getId() {
        return this.id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUrl() {
        return this.url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public GroupLogin getGroupLogin() {
        return this.groupLogin;
    }

    public void setGroupLogin(GroupLogin groupLogin) {
        this.groupLogin = groupLogin;
    }

}